package world.criver.h50909.controller;

import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import world.criver.h50909.dao.daoQuery;
import world.criver.h50909.entity.entEquipmentInfo;
import world.criver.h50909.entity.entModelInfo;
import world.criver.h50909.entity.entName;
import world.criver.h50909.response.resEquipmentSummaryList;
import world.criver.h50909.response.resModelNameList;
import world.criver.h50909.response.resModelSummaryList;
import world.criver.h50909.service.serQuery;

@RestController
@RequestMapping("/query")
public class conQuery implements daoQuery {
    @Autowired
    private serQuery serQuery;
    @Override
    @PostMapping("/model/list/name")
    public resModelNameList queryModelNameList() {
        return serQuery.queryModelNameList();
    }

    @Override
    @PostMapping("/equipment/list/summary")
    public resEquipmentSummaryList queryEquipmentSummaryList() {
        return serQuery.queryEquipmentSummaryList();
    }

    @Override
    @PostMapping("/model/list/summary")
    public resModelSummaryList queryModelSummaryList() {
        return serQuery.queryModelSummaryList();
    }

    @Override
    @PostMapping("/equipment/info")
    public entEquipmentInfo queryEquipmentInfo(@RequestBody entName info) {
        return serQuery.queryEquipmentInfo(info);
    }

    @Override
    @PostMapping("/model/info")
    public entModelInfo queryModelInfo(@RequestBody entName info) {
        return serQuery.queryModelInfo(info);
    }
}